/******************************************************************************
 *                  Shanghai ChipON Micro-Electronic Co.,Ltd
 ******************************************************************************
 *  @File Name        : kf8a100fxx_pwm.c
 *  @Author           : ChipON AE/FAE Group
 *  @Date             : 2023-12-19
 *  @HW Version       : KF8A100Fxx
 *  @Lib Version      : V2.0.1
 *  @Description      : This file provides the driver for the pwm module
 ******************************************************************************
 *  Copyright (C) by Shanghai ChipON Micro-Electronic Co.,Ltd
 *  All rights reserved.
 *
 *  This software is copyright protected and proprietary to
 *  Shanghai ChipON Micro-Electronic Co.,Ltd.
 *****************************************************************************/
/******************************************************************************
 *  |Date        |Version  |Author       |Description
 ******************************************************************************
 *  |2023-12-26  |V2.0     |Wang Junxiong|New creat
 *  |2025-08-08  |V2.0.1   |Wang Junxiong|Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles
 *****************************************************************************/

/******************************************************************************
 **                     QAC Warnings
 *****************************************************************************/
/* PRQA S 0436 EOF #8-bit MCU Features: Direct Write Registers. */
/* PRQA S 1291, 1820, 1821, 1822, 1823, 1851, 1853, 3715, 3757, 3760 EOF #Registers are essentially unsigned numbers. */
/* PRQA S 2754 EOF #Level 7 problem due to unsupported assembly instructions. */
/* PRQA S 3768, 3771, 4130, 4393, 4434, 4443, 4446, 4461, 4532 EOF #Registers are essentially unsigned numbers. */

/******************************************************************************
 *                      Include Files
 *****************************************************************************/
#include "kf8a100fxx_pwm.h"
/******************************************************************************
 *                      Macro Definitions
 *****************************************************************************/

/******************************************************************************
 *                      Constants
 *****************************************************************************/

/******************************************************************************
 *                      Type definitions
 *****************************************************************************/

/******************************************************************************
 *                      Variables
 *****************************************************************************/

/******************************************************************************
 *                      Function definitions
 *****************************************************************************/

/**
 * @brief Initialize T1 to 8-bit PWM mode
 *
 * @param Div PWM prescale
 * @param Period1 pwm 1 period value
 * @param Period2 pwm 2 period value
 */
void Pwm1_2_8BitModuleInit(Pwm1_2_PrescalerType Div, uint8_t Period1, uint8_t Period2)
{
    T1ON    = 0u;
    T1CLKSE = 0u;
    T1CTL   = (uint8_t)Div;
    T1H     = 0u;
    T1L     = 0u;
    PP2     = (uint8_t)Period2;
    PP1     = (uint8_t)Period1;

    T1ON = 1u;
}

/**
 * @brief Initialize PWM10 channel
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm10_8BitChannelEnable(uint8_t DutyValue)
{
    PWM10L = DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM10ON = 1u;
}

/**
 * @brief Initialize PWM11 channel
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm11_8BitChannelEnable(uint8_t DutyValue)
{
    PWM11L = DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM11ON = 1u;
}

/**
 * @brief Initialize PWM12 channel
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm12_8BitChannelEnable(uint8_t DutyValue)
{
    PWM12L = DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM12ON = 1u;
}

/**
 * @brief Initialize PWM13 channel
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm13_8BitChannelEnable(uint8_t DutyValue)
{
    PWM13L = DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM13ON = 1u;
}

/**
 * @brief Initialize PWM20 channel
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm20_8BitChannelEnable(uint8_t DutyValue)
{
    PWM20H = DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM20ON = 1u;
}

/**
 * @brief Initialize PWM21 channel
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm21_8BitChannelEnable(uint8_t DutyValue)
{
    PWM21H = DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM21ON = 1u;
}

/**
 * @brief Initialize PWM22 channel
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm22_8BitChannelEnable(uint8_t DutyValue)
{
    PWM22H = DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM22ON = 1u;
}

/**
 * @brief Initialize PWM23 channel
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm23_8BitChannelEnable(uint8_t DutyValue)
{
    PWM23H = DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM23ON = 1u;
}

/**
 * @brief Initialize T1 to 16-bit PWM mode
 *
 * @param Div PWM prescale
 * @param Period Periodic value: n*256
 */
void Pwm2_16BitModuleInit(Pwm1_2_PrescalerType Div, uint8_t Period)
{
    T1ON    = 0u;
    T1CLKSE = 0u;
    T1CTL   = (uint8_t)Div | 128u;
    T1H     = 0u;
    T1L     = 0u;
    PP2     = Period;
    PP1     = 0xffu;

    T1ON = 1u;
}

/**
 * @brief Initialize PWM20 channel
 *
 * @param DutyValue Duty value
 */
void Pwm20_16BitChannelEnable(uint16_t DutyValue)
{
    PWM20H = (uint8_t)(DutyValue >> 8u);
    PWM10L = (uint8_t)DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM20ON = 1u;
}

/**
 * @brief Initialize PWM21 channel
 *
 * @param DutyValue Duty value
 */
void Pwm21_16BitChannelEnable(uint16_t DutyValue)
{
    PWM21H = (uint8_t)(DutyValue >> 8u);
    PWM11L = (uint8_t)DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM21ON = 1u;
}

/**
 * @brief Initialize PWM22 channel
 *
 * @param DutyValue Duty value
 */
void Pwm22_16BitChannelEnable(uint16_t DutyValue)
{
    PWM22H = (uint8_t)(DutyValue >> 8u);
    PWM12L = (uint8_t)DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM22ON = 1u;
}

/**
 * @brief Initialize PWM23 channel
 *
 * @param DutyValue Duty value
 */
void Pwm23_16BitChannelEnable(uint16_t DutyValue)
{
    PWM23H = (uint8_t)(DutyValue >> 8u);
    PWM13L = (uint8_t)DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM23ON = 1u;
}

/**
 * @brief Initialize T3 to 16-bit PWM mode
 *
 * @param Div PWM prescale
 * @param Period Periodic value
 */
void Pwm3_16BitModuleInit(Pwm3_PrescalerType Div, uint16_t Period)
{
    uint8_t Source, RegTemp = SCF0;
    Source = SCF1 << 1u;
    Source += SCF1;
    Source ^= RegTemp;
    Source = Source << 1u;

    T3ON = 0u;
    /* Overloaded value setting */
    T3REH = (uint8_t)(Period >> 8u);
    T3REL = (uint8_t)Period;

    PP3H = (uint8_t)(Period >> 8u);
    PP3L = (uint8_t)Period;
    /* Enable reload, disable buzzer output, divide frequency, select clock, enable T3 */
    T3H   = 0u;
    T3L   = 0u;
    T3CTL = 0x81u | (uint8_t)Div | (uint8_t)Source;
}

/**
 * @brief Initialize PWM30 channel
 *
 * @param DutyValue Duty value
 */
void Pwm30_16BitChannelEnable(uint16_t DutyValue)
{
    PWM30H = (uint8_t)(DutyValue >> 8u);
    PWM30L = (uint8_t)DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM30ON = 1u;
}

/**
 * @brief Initialize PWM31 channel
 *
 * @param DutyValue Duty value
 */
void Pwm31_16BitChannelEnable(uint16_t DutyValue)
{
    PWM31H = (uint8_t)(DutyValue >> 8u);
    PWM31L = (uint8_t)DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM31ON = 1u;
}

/**
 * @brief Initialize PWM32 channel
 *
 * @param DutyValue Duty value
 */
void Pwm32_16BitChannelEnable(uint16_t DutyValue)
{
    PWM32H = (uint8_t)(DutyValue >> 8u);
    PWM32L = (uint8_t)DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM32ON = 1u;
}

/**
 * @brief Initialize PWM33 channel
 *
 * @param DutyValue Duty value
 */
void Pwm33_16BitChannelEnable(uint16_t DutyValue)
{
    PWM33H = (uint8_t)(DutyValue >> 8u);
    PWM33L = (uint8_t)DutyValue;
    /* Before enabling PWM1_2, it is necessary to wait for 4 NOP cycles */
    _NOP();
    _NOP();
    _NOP();
    _NOP();
    PWM33ON = 1u;
}

/**
 * @brief Initialize T1 to PWM mode
 *
 * @param Mode PWM mode
 * @param DeadZone PWM dead zone
 * @param Div prescale
 * @param Period PP5H, PP5L
 */
void Pwm5_16BitModuleInit(Pwm5_PwmModeType Mode, uint8_t DeadZone, Pwm5_CountDirectionType Direction,
                          Pwm5_PrescalerType Div, uint16_t Period)
{
    uint8_t reg_temp = 0u;
    T2ON             = 0u;
    reg_temp         = (PWM5CTL0 & 0xf0u) | (uint8_t)Mode;
    PWM5CTL0         = reg_temp;
    /* Enable automatic restart */
    PWM5CTL1 = 128u | (uint8_t)DeadZone;
    /* Remove fuse bit control of the PWM output port to allow the configuration of PWM5 to take effect */
    PWM5CTL2 = 0x07u;
    /* Initialize T2 */
    PP5H     = (uint8_t)(Period >> 8u);
    PP5L     = (uint8_t)Period;
    reg_temp = (T2CTL0 & 0xfcu) | (uint8_t)Div;
    T2CTL0   = reg_temp;
    T2CTL1   = (uint8_t)Direction;

    T2ON = 1u;
    T2H  = 0u;
    T2L  = 0u;
}

/**
 * @brief Initialize PWM5 channel 1
 *
 * @param Mode
 * @param DutyValue Duty value
 */
void Pwm5_16BitCh1Enable(Pwm5_CH1_PwmModeType Mode, uint16_t DutyValue)
{
    uint8_t reg_temp = 0u;
    if (Mode == PWM5_CH1_SINGLE_OUTPUT)
    {
        /* Outputs P5A, B/C/D, output steering update occurs at instruction cycle boundary */
        PSTRCTL0 = 0x0fu;
    }
    else if (Mode == PWM5_CH1_HALF_BRIDGE_OUTPUT)
    {
        PSTRCTL0 = 0x03u;
    }
    else if (Mode == PWM5_CH1_FULL_BRIDGE_FORWARD_OUTPUT)
    {
        PSTRCTL0 = 0x09u;
    }
    else if (Mode == PWM5_CH1_FULL_BRIDGE_REVERSE_OUTPUT)
    {
        PSTRCTL0 = 0x06u;
    }
    else
    {
        PSTRCTL0 = 0x00u;
    }
    reg_temp = (PWM5CTL0 & 0x3fu) | (uint8_t)Mode;
    PWM5CTL0 = reg_temp;
    /* Duty cycle output for PWM5 channel 1 */
    PWM5H0 = (uint8_t)(DutyValue >> 8u);
    PWM5L0 = (uint8_t)DutyValue;
}

/**
 * @brief Initialize PWM5 channel 2
 *
 * @param Mode PWM5 ch2 mode
 * @param DutyValue Duty value
 */

void Pwm5_16BitCh2Enable(Pwm5_CH2_PwmModeType Mode, uint16_t DutyValue)
{
    STRENA2  = 1u;
    STRENB2  = 1u;
    P5CH2MOD = (uint8_t)Mode;
    /* Duty cycle output for PWM5 channel 1 */
    PWM5H2 = (uint8_t)(DutyValue >> 8u);
    PWM5L2 = (uint8_t)DutyValue;
}
/**
 * @brief Initialize PWM5 channel 3
 *
 * @param Mode PWM5 ch3 mode
 * @param DutyValue Duty value
 */
void Pwm5_16BitCh3Enable(Pwm5_CH3_PwmModeType Mode, uint16_t DutyValue)
{
    STRENA3  = 1u;
    STRENB3  = 1u;
    P5CH3MOD = (uint8_t)Mode;
    /* Duty cycle output for PWM5 channel 1 */
    PWM5H3 = (uint8_t)(DutyValue >> 8u);
    PWM5L3 = (uint8_t)DutyValue;
}

/**
 * @brief Set T1 period
 *
 * @param Period1 pwm 1 period value
 */
void Pwm1_8BitSetPeriodValue(uint8_t Period1)
{
    PP1 = Period1;
    T1L = 0u;
}

/**
 * @brief Set T1 period
 *
 * @param Period2 pwm 2 period value
 */
void Pwm2_8BitSetPeriodValue(uint8_t Period2)
{
    PP2 = Period2;
    T1H = 0u;
}

/**
 * @brief Set PWM10 duty cycle value
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm10_8BitSetDutyValue(uint8_t DutyValue)
{
    PWM10L = DutyValue;
}

/**
 * @brief Set PWM11 duty cycle value
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm11_8BitSetDutyValue(uint8_t DutyValue)
{
    PWM11L = DutyValue;
}

/**
 * @brief Set PWM12 duty cycle value
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm12_8BitSetDutyValue(uint8_t DutyValue)
{
    PWM12L = DutyValue;
}

/**
 * @brief Set PWM13 duty cycle value
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm13_8BitSetDutyValue(uint8_t DutyValue)
{
    PWM13L = DutyValue;
}

/**
 * @brief Set PWM20 duty cycle value
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm20_8BitSetDutyValue(uint8_t DutyValue)
{
    PWM20H = DutyValue;
}

/**
 * @brief Set PWM21 duty cycle value
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm21_8BitSetDutyValue(uint8_t DutyValue)
{
    PWM21H = DutyValue;
}

/**
 * @brief Set PWM22 duty cycle value
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm22_8BitSetDutyValue(uint8_t DutyValue)
{
    PWM22H = DutyValue;
}

/**
 * @brief Set PWM23 duty cycle value
 *
 * @param DutyValue Duty Cycle Value
 */
void Pwm23_8BitSetDutyValue(uint8_t DutyValue)
{
    PWM23H = DutyValue;
}

/**
 * @brief Set T1 to 16-bit PWM mode
 *
 * @param Period Periodic value
 */
void Pwm2_16BitSetPeriodValue(uint8_t Period)
{
    PP2 = Period;
    PP1 = 0xffu;
    T1H = 0u;
    T1L = 0u;
}

/**
 * @brief Set PWM20 duty cycle value
 *
 * @param DutyValue Duty value
 */
void Pwm20_16BitSetDutyValue(uint16_t DutyValue)
{
    PWM20H = (uint8_t)(DutyValue >> 8u);
    PWM10L = (uint8_t)DutyValue;
}

/**
 * @brief Set PWM21 duty cycle value
 *
 * @param DutyValue Duty value
 */
void Pwm21_16BitSetDutyValue(uint16_t DutyValue)
{
    PWM21H = (uint8_t)(DutyValue >> 8u);
    PWM11L = (uint8_t)DutyValue;
}

/**
 * @brief Set PWM22 duty cycle value
 *
 * @param DutyValue Duty value
 */
void Pwm22_16BitSetDutyValue(uint16_t DutyValue)
{
    PWM22H = (uint8_t)(DutyValue >> 8u);
    PWM12L = (uint8_t)DutyValue;
}

/**
 * @brief Set PWM23 duty cycle value
 *
 * @param DutyValue Duty value
 */
void Pwm23_16BitSetDutyValue(uint16_t DutyValue)
{
    PWM23H = (uint8_t)(DutyValue >> 8u);
    PWM13L = (uint8_t)DutyValue;
}

/**
 * @brief Set T3 to 16-bit PWM mode
 *
 * @param Period Periodic value
 */
void Pwm3_16BitSetPeriodValue(uint16_t Period)
{
    /* Overloaded value setting */
    T3REH = (uint8_t)(Period >> 8u);
    T3REL = (uint8_t)Period;

    PP3H = (uint8_t)(Period >> 8u);
    PP3L = (uint8_t)Period;
    T3H  = 0u;
    T3L  = 0u;
}

/**
 * @brief Set PWM30 duty cycle value
 *
 * @param DutyValue Duty value
 */
void Pwm30_16BitSetDutyValue(uint16_t DutyValue)
{
    PWM30H = (uint8_t)(DutyValue >> 8u);
    PWM30L = (uint8_t)DutyValue;
}

/**
 * @brief Set PWM31 duty cycle value
 *
 * @param DutyValue Duty value
 */
void Pwm31_16BitSetDutyValue(uint16_t DutyValue)
{
    PWM31H = (uint8_t)(DutyValue >> 8u);
    PWM31L = (uint8_t)DutyValue;
}

/**
 * @brief Set PWM32 duty cycle value
 *
 * @param DutyValue Duty value
 */
void Pwm32_16BitSetDutyValue(uint16_t DutyValue)
{
    PWM32H = (uint8_t)(DutyValue >> 8u);
    PWM32L = (uint8_t)DutyValue;
}

/**
 * @brief Set PWM33 duty cycle value
 *
 * @param DutyValue Duty value
 */
void Pwm33_16BitSetDutyValue(uint16_t DutyValue)
{
    PWM33H = (uint8_t)(DutyValue >> 8u);
    PWM33L = (uint8_t)DutyValue;
}

/**
 * @brief Set T1 to PWM mode
 *
 * @param Period PP5H, PP5L
 */
void Pwm5_16BitSetPeriodValue(uint16_t Period)
{
    PP5H = (uint8_t)(Period >> 8u);
    PP5L = (uint8_t)Period;
    T2H  = 0u;
    T2L  = 0u;
}

/**
 * @brief Set PWM5 duty cycle value 1
 *
 * @param DutyValue Duty value
 */
void Pwm5_16BitCh1SetDutyValue(uint16_t DutyValue)
{
    /* Duty cycle output for PWM5 duty cycle value 1 */
    PWM5H0 = (uint8_t)(DutyValue >> 8u);
    PWM5L0 = (uint8_t)DutyValue;
}

/**
 * @brief Set PWM5 duty cycle value 2
 *
 * @param DutyValue Duty value
 */

void Pwm5_16BitCh2SetDutyValue(uint16_t DutyValue)
{
    /* Duty cycle output for PWM5 duty cycle value 1 */
    PWM5H2 = (uint8_t)(DutyValue >> 8u);
    PWM5L2 = (uint8_t)DutyValue;
}
/**
 * @brief Set PWM5 duty cycle value 3
 *
 * @param DutyValue Duty value
 */
void Pwm5_16BitCh3SetDutyValue(uint16_t DutyValue)
{
    /* Duty cycle output for PWM5 duty cycle value 1 */
    PWM5H3 = (uint8_t)(DutyValue >> 8u);
    PWM5L3 = (uint8_t)DutyValue;
}

/**
 * @brief Set Pwm 5 dead zone
 *
 * @param DeadZone PWM dead zone
 */
void Pwm5_16BitSetDeadZone(uint8_t DeadZone)
{
    uint8_t dead_zone_temp = ((uint8_t)PWM5CTL1 & 0x80u) | DeadZone;
    PWM5CTL1               = dead_zone_temp;
}

/**
 * @brief PWM1_2 deinitialization
 *
 */
void Pwm1_2_DeInit(void)
{
    T1CTL   = 0u;
    T1CLKSE = 1u;
    T1H     = 0u;
    T1L     = 0u;
    PP2     = 0u;
    PP1     = 0u;
    PWM10L  = 0u;
    PWM11L  = 0u;
    PWM12L  = 0u;
    PWM13L  = 0u;
    PWM20H  = 0u;
    PWM21H  = 0u;
    PWM22H  = 0u;
    PWM23H  = 0u;
    PWMCTL0 = 0u;
    PWMCTL1 = 0u;
}

/**
 * @brief PWM2 deinitialization
 *
 */
void Pwm2_DeInit(void)
{
    T1CTL   = 0u;
    T1CLKSE = 1u;
    T1H     = 0u;
    T1L     = 0u;
    PP2     = 0u;
    PP1     = 0u;
    PWM10L  = 0u;
    PWM11L  = 0u;
    PWM12L  = 0u;
    PWM13L  = 0u;
    PWM20H  = 0u;
    PWM21H  = 0u;
    PWM22H  = 0u;
    PWM23H  = 0u;
    PWMCTL1 = 0u;
}

/**
 * @brief PWM3 deinitialization
 *
 */
void Pwm3_DeInit(void)
{
    T3CTL   = 0u;
    PWM3CTL = 0u;

    T3REH = 0u;
    T3REL = 0u;

    PP3H = 0u;
    PP3L = 0u;
    T3H  = 0u;
    T3L  = 0u;

    PWM30L = 0u;
    PWM31L = 0u;
    PWM32L = 0u;
    PWM33L = 0u;
    PWM30H = 0u;
    PWM31H = 0u;
    PWM32H = 0u;
    PWM33H = 0u;
}

/**
 * @brief PWM5 deinitialization
 *
 */
void Pwm5_DeInit(void)
{
    T2CTL0 = 0u;
    T2CTL1 = 0u;
    PP5H   = 0u;
    PP5L   = 0u;
    T2H    = 0u;
    T2L    = 0u;

    PWM5L0 = 0u;
    PWM5L1 = 0u;
    PWM5L2 = 0u;
    PWM5L3 = 0u;
    PWM5H0 = 0u;
    PWM5H1 = 0u;
    PWM5H2 = 0u;
    PWM5H3 = 0u;

    PWM5CTL0 = 0u;
    PWM5CTL1 = 0u;
    PWM5CTL2 = 0x20u;
    PWM5PC   = 0u;
    PWM5FC   = 0u;
    PWM5OC   = 0u;
    P5ASCTL0 = 0u;
    P5ASCTL1 = 0u;
    PSTRCTL0 = 0x01u;
    PSTRCTL1 = 0x00u;
}

/* EOF */
